const appLoadingBar = document.querySelector('#app-loading-bar')

/**
 * 控制全部顶部loading
 * @param isLoading 是否loading
 */
const useLoading = (isLoading = false) => {
  if (appLoadingBar) {
    appLoadingBar.setAttribute(
      'style',
      `display: ${isLoading ? 'block' : 'none'}`
    )
  }
}
export default useLoading
